<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Jumbled Words Game</title>
</head>
<body>
	<table>
		<tr>
			<td width="800" bordercolor="red">
				<h1>This is the jumbled word</h1>
				<h3>
					<c:out value="${gameUnit.jumbledWord}" />
				</h3>

				<form name="form" action="guess.c">
					<h2>Guess the word:</h2>
					<br> <input name="textfield" type="text" size="30"> <br>
					<br> <input align="middle" name="word" type="submit"
						value="submit" /> <br> <br>
					<h3>
						<a href="nextJumbledWord.c">Move to the next word</a>
					</h3>

					<c:if test="${trigger==true}">
						<br>
	Please use the characters in the jumbled word
 	</c:if>
				</form></td>
			<td valign="top" class="guesses">
			<div>Guesses</div>
			<c:forEach var="guess" items="${gameUnit.guesses}">
					<c:choose>

						<c:when test="${guess.valid==true}">
							<div style="color: green">
								<c:out value="${guess.guessedWord}"></c:out>
								<img src="correct.gif" />
							</div>
						</c:when>

						<c:otherwise>
							<div style="color: red">
								<c:out value="${guess.guessedWord}"></c:out>
								<img src="wrong.gif" />

							</div>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</td>
		</tr>
	</table>

</body>
</html>